package com.wish.group05.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.group05.base.entity.CwPayOrder;
import com.wish.group05.base.mapper.CwPayOrderMapper;
import com.wish.group05.base.service.ICwPayOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 支付订单表（支付流水信息） 服务实现类
 * </p>
 *
 * @author houzehui
 * @since 2022-05-23
 */
@Slf4j
@Service
public class CwPayOrderServiceImpl extends ServiceImpl<CwPayOrderMapper, CwPayOrder> implements ICwPayOrderService {

    /*
     * 根据支付订单号（不是ID）查询支付订单
     */
    @Override
    public CwPayOrder selectPayOrderByOrderNo(String orderNo) {
        log.info("selectPayOrderByOrderNo处理 Start...");
        CwPayOrder selectOption = new CwPayOrder();
        selectOption.setOrderNo(orderNo);
        selectOption.setDelFlg(false);
        QueryWrapper<CwPayOrder> wrapper = new QueryWrapper<>(selectOption);
        CwPayOrder payOrder = getOne(wrapper);
        log.info("selectPayOrderByOrderNo处理 Start...");
        return payOrder;
    }
}
